New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexOutOfBoundsException while call suggest api #3196
Comments
can you provide an example request? |
On 06/17/2013 04:51 PM, Simon Willnauer wrote:
|
So you build ES from source based on master or based on the 0.90 branch? What Elasticsearch version did initially use when you ran the shell script? |
On 06/20/2013 08:05 PM, Martijn van Groningen wrote:
My OS is Ubuntu 12.04,have you met this problem? |
On 06/20/2013 08:05 PM, Martijn van Groningen wrote:
|
@piaolingxue I tried to run your script, but I don't run into the IndexOutOfBoundsException error. |
I've also had this exception (v. 0.90.2), it is unfortunately not consistently reproducable, the same query will sometimes work ok, and sometimes break. I can offer two hints though:
I will keep trying to make a contained test that breaks at least sometimes :) |
@gromgull is it the same stacktrace as above? |
Close, the underlying exception is nearly identical: 2013-07-24 11:30:03,532][DEBUG][action.search.type ] [Ghazikhanian, Carter] failed to reduce search
org.elasticsearch.action.search.ReduceSearchPhaseException: Failed to execute phase [fetch], [reduce]
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.finishHim(TransportSearchQueryThenFetchAction.java:177)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$3.onResult(TransportSearchQueryThenFetchAction.java:155)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$3.onResult(TransportSearchQueryThenFetchAction.java:149)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:346)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.executeFetch(TransportSearchQueryThenFetchAction.java:149)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction$2.run(TransportSearchQueryThenFetchAction.java:136)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.elasticsearch.search.suggest.Suggest$Suggestion.reduce(Suggest.java:246)
at org.elasticsearch.search.suggest.Suggest.reduce(Suggest.java:174)
at org.elasticsearch.search.controller.SearchPhaseController.merge(SearchPhaseController.java:404)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.innerFinishHim(TransportSearchQueryThenFetchAction.java:190)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.finishHim(TransportSearchQueryThenFetchAction.java:175)
... 8 more |
Eventually I was able to reproduce this! The reason here seems to be that there is more than one index and the indices share a field with the same name but different analysis chains that produce different number of tokens. It would be great if anybody could confirm that their setup also has more than one index were at least 2 indices share the same field with different analysis chains. I added a commit to a branch with a test that reproduces this issue. |
Added a fix for this in the commit above. IMO we should throw an exception and fail the reduce if the size is not the same. @martijnvg @imotov what do you think? |
Looks good to me. |
LGTM as well. |
@martijnvg @imotov I force pushed another change that also checks the entry keys since we also need to make sure we can merge them. There is also a test that checks it. Can you take another look? |
If the term suggester is used the results are merged depending on the number of terms produced by the tokenizer / tokenfilter. If a term suggester is executed across multiple indices that share the same field but with different analysis chains we can't merge the result anymore sicne tokens are our of order or have a different size. This commit throws ESIllegalArgumentException if the number of entries are not the same across all results. Closes elastic#3196
If the term suggester is used the results are merged depending on the number of terms produced by the tokenizer / tokenfilter. If a term suggester is executed across multiple indices that share the same field but with different analysis chains we can't merge the result anymore sicne tokens are our of order or have a different size. This commit throws ESIllegalArgumentException if the number of entries are not the same across all results. Closes #3196
If the term suggester is used the results are merged depending on the number of terms produced by the tokenizer / tokenfilter. If a term suggester is executed across multiple indices that share the same field but with different analysis chains we can't merge the result anymore sicne tokens are our of order or have a different size. This commit throws ESIllegalArgumentException if the number of entries are not the same across all results. Closes elastic#3196
If the term suggester is used the results are merged depending on the number of terms produced by the tokenizer / tokenfilter. If a term suggester is executed across multiple indices that share the same field but with different analysis chains we can't merge the result anymore sicne tokens are our of order or have a different size. This commit throws ESIllegalArgumentException if the number of entries are not the same across all results. Closes elastic#3196
java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
at java.util.ArrayList.rangeCheck(ArrayList.java:571)
at java.util.ArrayList.get(ArrayList.java:349)
at org.elasticsearch.search.suggest.Suggest$Suggestion.reduce(Suggest.java:251)
at org.elasticsearch.search.suggest.Suggest.reduce(Suggest.java:179)
at org.elasticsearch.action.suggest.TransportSuggestAction.newResponse(TransportSuggestAction.java:145)
at org.elasticsearch.action.suggest.TransportSuggestAction.newResponse(TransportSuggestAction.java:60)
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.finishHim(TransportBroadcastOperationAction.java:369)
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.onOperation(TransportBroadcastOperationAction.java:306)
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:265)
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction.performOperation(TransportBroadcastOperationAction.java:242)
at org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction$AsyncBroadcastAction$1.run(TransportBroadcastOperationAction.java:218)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
The text was updated successfully, but these errors were encountered: